﻿using System.ComponentModel.DataAnnotations;
using System.Text.RegularExpressions;

namespace Com.Service.DTO.ValidationAttributes
{
    public class PositiveFloatNum : ValidationAttribute
    {
        public override bool IsValid(object value)
        {
            var reg = new Regex(@"^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$");

            return reg.IsMatch(value.ToString());
        }
    }
}
